<?php
namespace app\admin\validate;
use think\Validate;

class Cat extends Validate
{
    
    protected $rule = [
        'cat'   =>  'require',
        'catid' =>  'require|number',
    ];

    protected $message = [
        'cat.require'   => '分类不能为空!',
        'catid.require' => '分类ID不能为空!',
        'catid.number'  => '分类ID错误!',
    ];

    protected $scene = [
        'create'    =>  ['cat'],
        'delete'    =>  ['catid'],
        'edit'      =>  ['cat','catid'],
    ];

}